package com.martian.controller;

import com.martian.service.DataLoaderService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.FileNotFoundException;
import java.text.ParseException;

/**
 * @author martian
 * @version V1.0.0
 * @Description
 * @date 2023-03-19 21:16
 */
@CrossOrigin
@Api(value = "DataLoaderController", tags = {"数据集加载器API"})
@RestController
@RequestMapping("/dataloader")
public class DataLoaderController {

    @Resource DataLoaderService dataLoaderService;

    @GetMapping("/movie")
    public void loadMovieData() throws FileNotFoundException {
        dataLoaderService.loadMovieData();
    }

    @GetMapping("userRating")
    public void loadUserRating() throws FileNotFoundException, ParseException {
        dataLoaderService.loadUserRating();
    }
    @GetMapping("/userLoader")
    public void loadUserInfo(){
        dataLoaderService.loadUserInfo();
    }
    @GetMapping("/movieRating")
    public void loadMovieRating(){
        dataLoaderService.loadMovieRating();
    }

}
